#!/usr/bin/python
# -*- coding: utf-8 -*-
# Created by binhou.li on 02/03/2018
# @Copyright

import logging
import os
import MySQLdb

WORK_PATH = os.path.dirname(os.path.abspath(__file__))

logging.basicConfig(level = logging.INFO,
                    format = '%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s',
                    datefmt = '%a, %d %b %Y %H:%M:%S',
                    filename = '%s/logs/fileserver.log' % (WORK_PATH),
                    filemode = 'a'
                    )


def db_connection():
    watch_path = '/tmp/'
    db_host = '10.69.130.43'
    db_user = 'dba'
    db_password = 'mysql'
    database = 'dcs'
    # db connect
    db = MySQLdb.connect(db_host, db_user, db_password, database)
    return db

gps_end = '.gps'
imu_end = '.imu'
rtv_end = '.rtv'
